package grafico;
import com.cloudgarden.layout.AnchorConstraint;
import com.cloudgarden.layout.AnchorLayout;

import java.awt.Dimension;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.JButton;

import javax.swing.WindowConstants;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;

/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class Menu extends Fondo {
	private JLabel Label1;
	private JButton Empezar;
	private JTextField NombreNegro;
	private JTextField NombreBlanco;
	private JLabel Label2;

	public Menu() {
		super("fondo");
		initGUI();
	}
	
	private void initGUI() {
		try {
			AnchorLayout thisLayout = new AnchorLayout();
			this.setLayout(thisLayout);
			this.setPreferredSize(new java.awt.Dimension(310, 301));
			{
				Empezar = new JButton();
				this.add(Empezar, new AnchorConstraint(815, 730, 905, 259, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL));
				Empezar.setText("Empezar");
				Empezar.setPreferredSize(new java.awt.Dimension(146, 27));
				Empezar.addMouseListener(new MouseAdapter() {
					public void mouseClicked(MouseEvent evt) {
						EmpezarMouseClicked(evt);
					}
				});
			}
			{
				NombreNegro = new JTextField();
				this.add(NombreNegro, new AnchorConstraint(543, 820, 676, 162, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL));
				NombreNegro.setText("Nombre Negro");
				NombreNegro.setPreferredSize(new java.awt.Dimension(204, 40));
				NombreNegro.addMouseListener(new MouseAdapter() {
					public void mouseClicked(MouseEvent evt) {
						if(NombreNegro.getText().equals("Nombre Negro"))
							NombreNegro.setText("");}
				});
			}
			{
				NombreBlanco = new JTextField();
				this.add(NombreBlanco, new AnchorConstraint(210, 820, 343, 162, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL));
				NombreBlanco.setText("Nombre Blanco");
				NombreBlanco.setPreferredSize(new java.awt.Dimension(204, 40));
				NombreBlanco.addMouseListener(new MouseAdapter() {
					public void mouseClicked(MouseEvent evt) {
						if(NombreBlanco.getText().equals("Nombre Blanco"))
							NombreBlanco.setText("");
					}
				});
			}
			{
				Label2 = new JLabel();
				this.add(Label2, new AnchorConstraint(370, 653, 523, 124, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL));
				Label2.setText("Nombre del jugador negro:");
				Label2.setPreferredSize(new java.awt.Dimension(164, 46));
			}
			{
				Label1 = new JLabel();
				this.add(Label1, new AnchorConstraint(41, 653, 191, 124, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL));
				Label1.setText("Nombre del jugador blanco:");
				Label1.setPreferredSize(new java.awt.Dimension(164, 45));
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	private void EmpezarMouseClicked(MouseEvent evt) {
		this.setVisible(false);
		Ventana.getInstance().agregarJugadores(NombreBlanco.getText(),NombreNegro.getText());
	}

}
